package com.caimiao.miao.page.home.page;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.caimiao.miao.R;
import com.caimiao.miao.interfaces.BaseFragmentImpl;

public class PageFragment extends BaseFragmentImpl<IPageContact.Presenter> implements IPageContact.View {
    private ImageView mIvAdvert;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (mPresenter == null) new PagePresenter(this);
    }

    @Override
    public int getLayoutRes() {
        return R.layout.fragment_advert;
    }

    @Override
    public void initUI() {
        mIvAdvert = mRootView.findViewById(R.id.advertPageIvPic);
    }

    @Override
    public void initLogic() {
        if (mPresenter != null) {
            mPresenter.setLogic();
        }
    }

    @Override
    public void setAdvert(String uri) {
        Glide.with(this).load(uri).into(mIvAdvert);
    }

}
